<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>父级边框塌陷</title>
    <style>
        /*.clear{*/
            /*!*clear:right ;*!*/
            /*!*clear: left;*!*/
            /*clear: both;*/
        /*}*/

        #div1{
            background: #FF0000;
            width: 200px;
            height: 200px;
            float: left;
        }
        #div2{
            background: black;
            width: 200px;
            height: 200px;
            float: right;
        }
        #divall{
            border: 2px solid blue;
            /*!*overflow: hidden;!*溢出隐藏*!*!    下拉列表场景不能使用*/
        }
        #divall:after{
            content:'' ;
            display: block;
            clear: both;
        }
    </style>
</head>
<body>
<div id="divall">
    <div id="div1"></div>

    <div id="div2"></div>
    <div class="clear"></div>
</div>
</body>
</html>